<template>
   <van-tabbar route>
      <van-tabbar-item icon="home-o" to="/">家</van-tabbar-item>
      <van-tabbar-item icon="apps-o" to="/category">分类</van-tabbar-item>
      <van-tabbar-item icon="cart-o" to="/cart">车</van-tabbar-item>
      <van-tabbar-item icon="user-o" :to="path">{{text}}</van-tabbar-item>
   </van-tabbar>
</template>

<script setup lang="ts">
import { computed } from 'vue';
// import  {useUserStore} from '@/store/userStore'
// const user = useUserStore();
const user = {
  userid:'我的'
}
// 最后一个van-tabbar-item显示的文字
const text = computed(()=>{
   return user.userid?'我的':'请登录'
})
// 最后一个van-tabbar-item跳转的path
const path = computed(()=>{
   return user.userid?'/user':'/login'
})
</script>

<style scoped lang="scss">

</style>
